<!-- inc:header -->
<div class="notice"><div class="p">
	<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td><span class="lead">&nbsp;&raquo; <a href="{:site_url('usergroup')}">会员组管理</a> &raquo; 添加/编辑信息</span></td>
	</tr>
	</table>
</div></div>

<form method="post" action="{:site_url('usergroup,setok')}id={:$id}" onsubmit="return to_submit();">
<div class="table">
	<div class="left"><span class="red">*</span> 组名称：</div>
	<input type="text" name="title" id="title" value="{:$rs[title]}">
</div>
<div class="table">
	<div class="left">权限设置：</div>
	<span class="clue_on" height="25px">请按钮Ctrl键进行多选，除阅读权限可设置“全部”外，其他均须手动设置</span>
</div>

<div class="table">
	<div class="left">发布：</div>
	<select name="popedom_post[]" multiple style="width:300px;height:150px;">
		<!-- if($modulelist) -->
		<optgroup label="模块">
			<!-- $modulelist AS $key=>$value -->
			<option value="m:{:$value[id]}"{if(in_array('m:'.$value[id],$p_post))} selected{end}>{:$value[title]}</option>
			<!-- end -->
		</optgroup>
		<!-- end -->
		<!-- if($catelist) -->
		<optgroup label="分类">
			<!-- $catelist AS $key=>$value -->
			<option value="c:{:$value[id]}"{if(in_array('c:'.$value[id],$p_post))} selected{end}>{:$value[space]}{:$value[cate_name]}</option>
			<!-- end -->
		</optgroup>
		<!-- end -->
	</select>
</div>

<div class="table">
	<div class="left">回复：</div>
	<select name="popedom_reply[]" multiple style="width:300px;height:150px;">
		<!-- if($modulelist) -->
		<optgroup label="模块">
			<!-- $modulelist AS $key=>$value -->
			<option value="m:{:$value[id]}"{if(in_array('m:'.$value[id],$p_reply))} selected{end}>{:$value[title]}</option>
			<!-- end -->
		</optgroup>
		<!-- end -->
		<!-- if($catelist) -->
		<optgroup label="分类">
			<!-- $catelist AS $key=>$value -->
			<option value="c:{:$value[id]}"{if(in_array('c:'.$value[id],$p_reply))} selected{end}>{:$value[space]}{:$value[cate_name]}</option>
			<!-- end -->
		</optgroup>
		<!-- end -->
	</select>
</div>

<div class="table">
	<div class="left">阅读：</div>
	<select name="popedom_read[]" multiple style="width:300px;height:150px;">
		<option value="all"{if(in_array('all',$p_read))} selected{end}>全部</option>
		<!-- if($modulelist) -->
		<optgroup label="模块">
			<!-- $modulelist AS $key=>$value -->
			<option value="m:{:$value[id]}"{if(in_array('m:'.$value[id],$p_read))} selected{end}>{:$value[title]}</option>
			<!-- end -->
		</optgroup>
		<!-- end -->
		<!-- if($catelist) -->
		<optgroup label="分类">
			<!-- $catelist AS $key=>$value -->
			<option value="c:{:$value[id]}"{if(in_array('c:'.$value[id],$p_read))} selected{end}>{:$value[space]}{:$value[cate_name]}</option>
			<!-- end -->
		</optgroup>
		<!-- end -->
	</select>
</div>

<div class="table">
	<div class="left">免审核：</div>
	<table>
	<tr>
		<td><input type="checkbox" id="post_cert" name="post_cert"{if($rs[post_cert])} checked{end} /></td>
		<td>发布&nbsp; &nbsp;</td>
		<td><input type="checkbox" id="reply_cert" name="reply_cert"{if($rs[reply_cert])} checked{end} /></td>
		<td>回复&nbsp; &nbsp;</td>
	</tr>
	</table>
</div>

<div class="table">
	<div class="left">&nbsp;</div>
	<input type="submit" class="btn3" id="_phpok_submit" name="article_submit" value=" 提交 ">
</div>

</form>

<script type="text/javascript">
function to_submit()
{
	var name = getid("name").value;
	if(!name)
	{
		alert("会员名不允许为空");
		getid("name").focus();
		return false;
	}
	var email = getid("email").value;
	if(!email)
	{
		alert("邮箱不允许为空");
		getid("email").focus();
		return false;
	}
	<!-- if(!$id) -->
	var pass = getid("pass").value;
	if(!pass)
	{
		alert("密码不允许为空");
		getid("pass").focus();
		return false;
	}
	<!-- end -->
	//通过Ajax检测会员账号和邮箱是否重复
	var url = "{:site_url('user,chk')}id={:$id}&email="+EncodeUtf8(email)+"&name="+EncodeUtf8(name);
	var msg = get_ajax(url);
	if(!msg) msg = "error: 检测失败";
	if(msg != "ok")
	{
		alert(msg);
		return false;
	}
	getid("_phpok_submit").disabled = true;
}
</script>
<!-- inc:footer -->